<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>concat</title>
	</head>
	<body>
		<script>
			// concat 方法用于合并两个或多个数组
			// 返回值是合并后的新数组，但是并不会改变原数组

			// 1. 连接两个数组
			let arr1 = [1, 2, 3];
			let arr2 = [7, 8, 9];
			let arr3 = arr1.concat(arr2);
			console.log(arr3);

			// 2. 连接多个数组
			let arr4 = [10, 20, 30];
			let arr5 = [100, 200, 300];
			let arr0 = arr3.concat(arr4, arr5);
			console.log(arr0);
		</script>
	</body>
</html>
